import java.util.Random;
import java.util.Scanner;

public class 猜数字 {

    public static void main(String[] args) {
        System.out.println("猜数字游戏开始");
        System.out.println("输入1-100之间的数据：");
        Random ran = new Random();
        int ranNumber = ran.nextInt(100) + 1;
        Scanner in = new Scanner(System.in);
        while (true) {
            for (int i = 1; true; i++) {

                int number = in.nextInt();
                if (number == ranNumber) {
                    if (i == 1) {
                        System.out.println("你真厉害，一次就猜对了！");
                        break;
                    } else if (i >= 2 && i <= 4) {
                        if (number == ranNumber) {
                            System.out.println("你很厉害，猜对了！");
                            break;
                        } else if (i >= 5) {
                            if (number == ranNumber) {

                                System.out.println("笨蛋，你猜这么多次！");
                                break;
                            }
                            System.out.println("程序结束！");
                        }

                    }

                }
            }
        }
    }
}
